package org.piggy.common.exception;

import org.piggy.common.enums.ResponseCode;
import java.io.Serial;

public class BasicException extends RuntimeException {

    @Serial
    private static final long serialVersionUID = -5658789202563433456L;

    public BasicException() {
    }

    protected ResponseCode code;

    public BasicException(String message, ResponseCode code) {
        super(message);
        this.code = code;
    }

    public BasicException(String message, Throwable cause, ResponseCode code) {
        super(message, cause);
        this.code = code;
    }

    public BasicException(ResponseCode code, Throwable cause) {
        super(cause);
        this.code = code;
    }

    public BasicException(String message, Throwable cause,
                          boolean enableSuppression, boolean writableStackTrace, ResponseCode code) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.code = code;
    }

    public ResponseCode getCode() {
        return code;
    }

}
